define([
    'jQuery',
    'Underscore',
    'Backbone',
    'Kendo',
    'models/treespecie',
], function($, _, Backbone, Kendo, Treespecie) {

    
    
    var treespecieDatasource = new kendo.data.DataSource({
        
        
        schema: {
            data: "data",
            model: Treespecie, 
            total: function(response) {
                return $(response.data).length;
            }
        },
        
        
        
        pageSize: 10,
        
        
        
        transport: {
            
            read: "/vta/treespecie/all.json",
            
            update: {
                url: "/vta/treespecie/update.json",
                type: "POST"
            },
            
            create: {
                url: "/vta/treespecie/create.json",
                type: "PUT"
            }
        
        },
        
        
        
        error: function(e) {
            alert(e.responseText);
        },
        
        
        
        sort: {
            field: 'id',
            dir: 'asc'
        }
        
        
                
    });
    
    
    
    return treespecieDatasource;
    
    
    
});